package hr.aaameter.protocol;

import java.nio.ByteBuffer;

/**
 * 
 * @author hr1ur093
 *
 */
public interface Parser {

	/**
	 * Encode POJO (created somewhere else) into a protocol represantation
	 * and put it into buffer to be used by transport layer (for sending out)
	 * @param msg 
	 */
	ByteBuffer encode(Message msg);
	
	/**
	 * Decode packet from transport layer into a POJO
	 * @return
	 */
	Message decode(ByteBuffer buffer);
	
}
